# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=hyperfine
pkgver=1.10.0
pkgrel=2
pkgdesc="Command-line benchmarking tool"
url="https://github.com/sharkdp/hyperfine"
arch="x86_64 armv7 armhf aarch64 x86 ppc64le" # Limited by cargo
license="Apache-2.0 AND MIT"
makedepends="cargo"
subpackages="$pkgname-doc
	$pkgname-bash-completion
	$pkgname-zsh-completion
	$pkgname-fish-completion
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/sharkdp/hyperfine/archive/v$pkgver.tar.gz"

build() {
	cargo build --release --locked
}

check() {
	cargo test all --release --locked
}

package() {
	install -Dm755 target/release/hyperfine \
		"$pkgdir"/usr/bin/hyperfine
	install -Dm644 doc/hyperfine.1 \
		"$pkgdir"/usr/share/man/man1/hyperfine.1

	install -Dm644 target/release/build/hyperfine-*/out/hyperfine.bash \
		"$pkgdir/usr/share/bash-completion/completions/hyperfine"
	install -Dm644 target/release/build/hyperfine-*/out/_hyperfine \
		"$pkgdir/usr/share/zsh/site-functions/_hyperfine"
	install -Dm644 target/release/build/hyperfine-*/out/hyperfine.fish \
		"$pkgdir/usr/share/fish/completions/hyperfine.fish"
}

sha512sums="4d5a1549f8b35601fd1b3e2978c2a1be494adbcf3b614657005e4cf5b909bfb3999d4e31eb988d63cf20c2f41c0dcce1785306a46664d89357cec34c9a03c04a  hyperfine-1.10.0.tar.gz"
